/**
 * 
 */
package scriptrunner.execution;

import java.io.Serializable;

/**
 * @author Administrator
 * 
 */
public class NamedScriptFunction extends Function implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6198230303903098854L;

	/**
	 * @param pl
	 */
	public NamedScriptFunction(String id, ParameterList pl, StatementList sl) {
		super(id, pl);
		this.sl = sl;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * scriptrunner.execution.Function#Execute(scriptrunner.execution.Session)
	 */
	@Override
	public ValueObject Execute(Session se) throws ExecuteErrorException {
		sl.Execute(se);
		return se.getReturnResult();
	}

	StatementList sl;
}
